import Mock from 'mockjs'
const list = Mock.mock({
  'list|10': [
    {
      'accountId': '@id',
      'accountTitle|1': [1, 2, 3, 4],
      'accountTitleString|1': [1, 2, 3, 4],
      'amount|0-999': 0,
      'fundDirection|1': [1, 2],
      'historyId': '@id',
      'historyNo': '@id',
      'historyTime': '@now',
      'objectId': '@id',
      'objectType|1': [1, 2],
      'remark|1': '@word',
      'voucherId': '@id',
      'voucherTypeId': '@id',
      'voucherTypeName': '@cname'
    }
  ]
})
const dictMap = {
  accountTitle: {
    1: '余额',
    2: '可提现余额',
    3: '未结算应付',
    4: '未结算应收'
  },
  accountTitleString: {
    1: '余额',
    2: '可提现余额',
    3: '未结算应付',
    4: '未结算应收'
  },
  objectType: {
    1: '任务',
    2: '提前结算申请'
  }
}
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 1,
  totalPage: 1
}
const invoice = Mock.mock({
  'list|10': [{
    invoiceNo: '@integer'
  }],
  ...pub
})
export default [
  // 根据参数查询电工账户流水
  {
    url: '/finance/finance/listAccountHistory',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: [...list.list],
        dictMap,
        msg: ''
      }
    }
  },
  // 根据参数查询电工账户流水
  {
    url: '/finance/finance/getInvoiceListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: invoice,
        dictMap,
        msg: ''
      }
    }
  }

]
